package com.hyt.it.ogt.kq.service.gov.feign.pt;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hyt.common.apiInfor.ApiResponse;
import com.hyt.it.ogt.kq.service.gov.model.dto.ExamSubjectDTO;
import com.hyt.it.ogt.kq.service.gov.model.dto.OrganizationDTO;
import com.hyt.it.ogt.kq.service.gov.model.dto.PtCandidateDTO;
import com.hyt.it.ogt.kq.service.gov.model.dto.PtOfficeAreaDTO;
import com.hyt.it.ogt.kq.service.gov.model.entity.OfficeArea;
import com.hyt.it.ogt.kq.service.gov.model.entity.TaskArea;
import com.hyt.it.ogt.kq.service.gov.model.param.ExamSubjectParam;
import com.hyt.it.ogt.kq.service.gov.model.param.PtCandidateParam;
import com.hyt.it.ogt.kq.service.gov.model.vo.TestClassifyVO;
import com.hyt.it.ogt.kq.service.model.entity.Candidate;
import com.hyt.it.ogt.kq.service.model.entity.Subject;
import com.hyt.loginfo.config.OAuth2FeignRequestConfig;
import com.hyt.model.PageParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperationSort;
import jdk.nashorn.internal.ir.IdentNode;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 平台客户端熔断器
 *
 * @author chengxh
 * @since 2021-11-26
 */
@FeignClient(name="it-ogt-sq", contextId = "gov-it-ogt-pt",fallback = GovPtClientHystrix.class, configuration = OAuth2FeignRequestConfig.class)
public interface GovPtClient {
    /**
     * 获取考试分类
     * @return
     */
    @GetMapping("/pt/examination-category/getTreelist")
    ApiResponse<TestClassifyVO> getTreelist();

    /**
     * 获取考场数据
     * @param roomIdList
     * @return
     */
    @PostMapping("/gl/office/room/getRooms")
    ApiResponse<Object> getRooms(@RequestBody List<String> roomIdList);

    /**
     * 查询机考考点信息
     */
    @PostMapping("/gl/office/place/getPlaces")
    ApiResponse<Object> getTaskPlace(@RequestBody List<String> placeIdList);

    /**
     * 根据区域id获取区域
     * @param areaIds
     * @return
     */
    @PostMapping(value = "/gl/office/area/getAreaByIds")
    ApiResponse<Object> getAreaByIds(@RequestBody List<String> areaIds);

    /**
     * 通过部门id查询详情
     * @param deptId
     * @return
     */
    @GetMapping(value = "/gl/ogt/kw/dept/get/one")
    ApiResponse<Object> getOne(@RequestParam String deptId);

    /**
     * 通过部门id查询详情列表
     * @param deptIds
     * @return
     */
    @PostMapping(value = "/gl/ogt/kw/dept/get/list")
    ApiResponse<List<Object>> getList(@RequestBody List<String> deptIds);


    /**
     * 通过区域的id获取全称
     * @param areaId
     * @return
     */
    @GetMapping(value = "/gl/office/area/joinAreaAddress")
    ApiResponse<Object> joinAreaAddress(@RequestParam String areaId);

    /**
     *获取全量的考场类型
     * @return
     */
    @PostMapping("/pt/examRoomType/list")
    ApiResponse<Object> listAll();

    @GetMapping(value = "/gl/office/area/getAllAreas")
    ApiResponse<List<PtOfficeAreaDTO>> getAllAreas();

    @RequestMapping(value = "/pt/examSubject/getByPage", method = RequestMethod.GET)
    ApiResponse<Page<ExamSubjectDTO>> getByPage(@RequestParam PageParam<Subject> pageParam,
                                                @RequestParam ExamSubjectParam examSubjectParam);

    /**
     * 查询平台中指定id的科目信息
     * @param subjectIds
     * @return
     */
    @RequestMapping(value = "/pt/examSubject/listAll", method = RequestMethod.POST)
    ApiResponse<List<ExamSubjectDTO>> listAll(@RequestBody(required = false) List<String> subjectIds);

    /**
     * 从平台查询考生
     * @param pageParam
     * @param ptCandidateParam
     * @return
     */
    @RequestMapping(value = "/pt/candidate/getByPage", method = RequestMethod.GET)
    ApiResponse<Page<PtCandidateDTO>> getByPage(@RequestParam Integer size,@RequestParam Integer current,
                                                @RequestParam(required = false) List<String> deptIds,
                                                @RequestParam(required = false) List<String> candidateIds);

}
